import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '执行结果',
    align: "center",
    sorter: true,
    dataIndex: 'executeResult'
  },
  {
    title: '执行人',
    align: "center",
    sorter: true,
    dataIndex: 'caseExecutor'
  },
  {
    title: '执行时间',
    align: "center",
    sorter: true,
    dataIndex: 'executeTime'
  },
  {
    title: '前提条件',
    align: "center",
    sorter: true,
    dataIndex: 'prerequisite'
  },
  {
    title: '数据需求',
    align: "center",
    sorter: true,
    dataIndex: 'dataRequire'
  },
  {
    title: '操作步骤',
    align: "center",
    sorter: true,
    dataIndex: 'description'
  },
  {
    title: '预期结果',
    align: "center",
    sorter: true,
    dataIndex: 'expectResult'
  },
  {
    title: '实际结果',
    align: "center",
    sorter: true,
    dataIndex: 'actualResult'
  },
  {
    title: '截图上传',
    align: "center",
    sorter: true,
    dataIndex: 'executeRecordPic',
    customRender: render.renderImage,
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "案例执行id",
    field: 'caseExecuteId',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "执行结果",
    field: 'executeResult',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "执行人",
    field: 'caseExecutor',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "执行时间",
    field: 'executeTime',
    component: 'DatePicker',
    componentProps: {
      showTime: true,
    },
    //colProps: {span: 6},
  },
  {
    label: "前提条件",
    field: 'prerequisite',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "数据需求",
    field: 'dataRequire',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "操作步骤",
    field: 'description',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "预期结果",
    field: 'expectResult',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "实际结果",
    field: 'actualResult',
    component: 'Input',
    //colProps: {span: 6},
  },
  {
    label: "截图上传",
    field: 'executeRecordPic',
    component: 'Input',
    //colProps: {span: 6},
  },
];

//表单数据
export const formSchema: FormSchema[] = [
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];

// 高级查询数据
export const superQuerySchema = {
  executeResult: {title: '执行结果',order: 1,view: 'text', type: 'string',},
  caseExecutor: {title: '执行人',order: 2,view: 'text', type: 'string',},
  executeTime: {title: '执行时间',order: 3,view: 'datetime', type: 'string',},
  prerequisite: {title: '前提条件',order: 4,view: 'text', type: 'string',},
  dataRequire: {title: '数据需求',order: 5,view: 'text', type: 'string',},
  description: {title: '操作步骤',order: 6,view: 'text', type: 'string',},
  expectResult: {title: '预期结果',order: 7,view: 'text', type: 'string',},
  actualResult: {title: '实际结果',order: 8,view: 'text', type: 'string',},
  executeRecordPic: {title: '截图上传',order: 9,view: 'image', type: 'string',},
};
